package timtest.android.project;
import android.app.Activity;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Bundle;
import android.os.Handler;
import android.widget.RelativeLayout;

public class testing extends Activity
{
	DrawView mDrawView;
	Paint paint;
	Path path;
	Thread infinitLoop = new Thread();
	int x;
	int y;
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        mDrawView = new DrawView(this);
        mDrawView.setBackgroundColor(Color.WHITE);       
    }

    protected void onStart()
    {
    	super.onStart();
    	mDrawView.setBackgroundColor(Color.BLACK);
    }
    
    protected void onRestart()
    {
    	super.onRestart();
    	mDrawView.setBackgroundColor(Color.RED);
    }

    protected void onResume()
    {
    	super.onResume();
    	mDrawView.setBackgroundColor(Color.YELLOW);
    	Thread mainLoop = new Thread() 
    	{
    		public void run()
    		{
    			try 
    			{
    				while (true)
    				{
    					sleep(10);
    					mDrawView.postInvalidate();
    				}
				} 
    			catch (InterruptedException e) 
    			{
					e.printStackTrace();
				}
    		}
    	};
    	mainLoop.start();	
		setContentView(mDrawView);
    }

    protected void onPause()
    {
    	super.onPause();
    	mDrawView.setBackgroundColor(Color.YELLOW);
    }

    protected void onStop()
    {
    	super.onStop();
    	mDrawView.setBackgroundColor(Color.WHITE);
    }

    protected void onDestroy()
    {
    	super.onDestroy();
    }
    
    private final Handler mHandler = new Handler();

}

